function [tge,blon,blat]=cadtge3(tge,blon,blat);
%*** ***************************************************************
%*** * Calculates transformation matrix TGE from longitude and latitude
%*** *
%*** * Argument Output:
%*** *          TGE(3,3) =Transf. of geographic wrt earth coor
%*** * Argument Input:
%*** *          BLON =Missile longitude - rad
%*** *          BLAT =Missile latitude - rad
%*** *
%*** * MODIFICATION HISTORY
%*** * 960628 Created by Peter Zipfel
%*** *
%*** ***************************************************************

  tge_orig=tge;tge_shape=[3,3];tge=reshape([tge_orig(1:min(prod(tge_shape),numel(tge_orig))),zeros(1,max(0,prod(tge_shape)-numel(tge_orig)))],tge_shape);
  global bcom_1; if isempty(bcom_1), bcom_1=zeros(1,3510); end;
  %% common  c(3510);
  %% common  bcom_1(3510);

  slon=sin(blon);
  clon=cos(blon);
  slat=sin(blat);
  clat=cos(blat);
  tge(1,1)=-slat.*clon;
  tge(1,2)=-slat.*slon;
  tge(1,3)=clat;
  tge(2,1)=-slon;
  tge(2,2)=clon;
  tge(2,3)=0.;
  tge(3,1)=-clat.*clon;
  tge(3,2)=-clat.*slon;
  tge(3,3)=-slat;

  tge_orig(1:min(prod(tge_shape),numel(tge_orig)))=tge(1:min(prod(tge_shape),numel(tge_orig)));tge=tge_orig;
  return;

end %subroutine cadtge3